package com.touch.graphingutil;
import java.awt.*;

/**
 * The GraphItem class represents an individual Object value used in a JGraph.
 * The object has three values: Title which is displayed on the graph, Value or the Y value on the graph, and the Color used for the graph.
 */
public class GraphItem
{
	/** the title of the item can only be set from within the package. */	
	protected String title;
	/** the value of the item can only be set from within the package. */
	protected int value;
	/** the color of the item can only be set from within the package. */
	protected Color color;
	
	/**
	 * Creates a new GraphItem by specifying a title, a value, and a color.
	 * @param title Label of the item on the graph. Also, this is how the GraphItem is indexed. 
	 * @param value Y-Value of the Graph Item.
	 * @param color Color to be used.
	 */
	public GraphItem(final String title, final int value, final Color color) 
	{
		this.title = title;
		this.value = value;
		this.color = color;
	}
	/**
	 * Displays the info of the GraphItem.
	 */
	public String toString()
	{
		return this.title + ":" + this.value;
	}
	/**
	 * Gets the color of the GraphItem.
	 * @return
	 */
	public Color getColor()
	{
		return this.color;
	}
	/**
	 * Gets the Value associated with the GraphItem
	 * @return
	 */
	public int getValue()
	{
		return this.value;
	}
	/**
	 * Gets the title of the GraphItem.
	 * @return
	 */
	public String getTitle()
	{
		return this.title;
	}
}
